<?php

namespace app\admin\controller;

use app\common\lib\Util;
use app\common\lib\redis\Predis;

class Live
{

    public function push()
    {
        // 取出redis中的值
        $teams = [
            1 => [
                'name' => '马刺',
                'logo' => '/live/imgs/team1.png',
            ],
            4 => [
                'name' => '火箭',
                'logo' => '/live/imgs/team2.png',
            ],
        ];
        $taskData = [
            'method' => 'pushLive',
            'data' => [
                'type' => intval($_GET['type']),
                'title' => !empty($teams[$_GET['team_id']]['name'])?$teams[$_GET['team_id']]['name']:'直播员',
                'logo' => !empty($teams[$_GET['team_id']]['logo'])?$teams[$_GET['team_id']]['logo']:'',
                'content' => !empty($_GET['content'])?$_GET['content']:'',
                'image' => !empty($_GET['image'])?$_GET['image']:'',    
            ],
        ];
        $_POST['http_server']->task($taskData);
    }

}